<#import "/macro.ftl" as m>
<@m.page_header title='后台' />
<div id="page-content-wrapper">

<div id="page-title">
    <h3>
        整体产品统计
    </h3>
</div>

<div class="example-box">
	<div class="example-code">

        <a href="/stat/statall" class="btn large primary-bg" title="">
            <span class="button-content">今日统计</span>
        </a>
        &nbsp;&nbsp;
        <a href="/stat/manydaysstatall/1" class="btn large primary-bg" title="">
            <span class="button-content">昨日统计</span>
        </a>
        &nbsp;&nbsp;
        <a href="/stat/manydaysstatall/7" class="btn large primary-bg" title="">
            <span class="button-content">7日统计</span>
        </a>
        &nbsp;&nbsp;
        <a href="/stat/manydaysstatall/30" class="btn large primary-bg" title="">
            <span class="button-content">30日统计</span>
        </a>
        &nbsp;&nbsp;
        <a href="/stat/alldaysstat" class="btn large primary-bg" title="">
            <span class="button-content">全部统计</span>
        </a>

	</div>
</div>

   		<#if msg!='a'&&msg!='b'&&msg!='d'&&param!='a'>
   	    <form id="form" action="/stat/statall" method="get">
    		<div class="form-row">
    			<div class="form-input col-md-2">
    				<#if startTime>
            		<input type="text"   name="startTime" data-trigger="focus" data-required="true" class="parsley-validated" value="${startTime}" onClick="WdatePicker({isShowWeek:true,dateFmt:'yyyy-MM-dd'})" style="clear:both;overflow:hidden;display:block">
          			<#else>
    				<input placeholder="时间" type="text"   name="startTime" data-trigger="focus" data-required="true" class="parsley-validated" value="" onClick="WdatePicker({isShowWeek:true,dateFmt:'yyyy-MM-dd'})" style="clear:both;overflow:hidden;display:block">
    				</#if>
    			</div>
    			<div class="form-input col-md-2">
		        	<a href="javascript:;" class="btn large primary-bg radius-all-4" id="search" title="Validate!" onclick="$('#form').trigger('submit');">
			            <span class="button-content">
			                查询
			            </span>
	                </a>
		        </div>
    		</div>
    	</form>
    	</#if>
   
<div class="pad10A">
<div class="col-md-5">
	<h3 class="content-box-header bg-gray">
		<span>金额</span>
    </h3>
    <div class="form-row">
        <div class="form-label col-md-5">
            <label for="">
               <#if msg=='a'>7日总销量:<#elseif msg=='b'>30日总销量:<#elseif msg=='c'>总销量:<#elseif msg=='d'>昨日销量:<#else>今日总销量:</#if><span class="required"></span>
            </label>
        </div>
        <div class="form-input col-md-5">
            <input type="text" id="dayTotalSales"  name="dayTotalSales" data-type="number" class="parsley-validated" value="${dayTotalSales}">
        </div>
        <div class="col-md-2">元</div>
    </div>
    <div class="form-row">
        <div class="form-label col-md-5">
            <label for="">
                <#if msg=='a'>7日待付款:<#elseif msg=='b'>30日待付款:<#elseif msg=='c'>待付款:<#elseif msg=='d'>昨日待付款:<#else>今日待付款:</#if><span class="required"></span>
            </label>
        </div>
        <div class="form-input col-md-5">
            <input type="text" id="dayUnpay"  name="dayUnpay" data-type="number"  class="parsley-validated" value="${dayUnpay}">
        </div>
        <div class="col-md-2">元</div>
    </div>
    <div class="form-row">
        <div class="form-label col-md-5">
            <label for="">
                <#if msg=='a'>7日已付款:<#elseif msg=='b'>30日已付款:<#elseif msg=='c'>已付款:<#elseif msg=='d'>昨日已付款:<#else>今日已付款:</#if><span class="required"></span>
            </label>
        </div>
        <div class="form-input col-md-5">
            <input type="text" id="dayPaid" name="dayPaid" data-type="number"  class="parsley-validated" value="${dayPaid}">
        </div>
        <div class="col-md-2">元</div>
    </div>
    <div class="form-row">
        <div class="form-label col-md-5">
            <label for="">
                <#if msg=='a'>7日到期未付:<#elseif msg=='b'>30日到期未付:<#elseif msg=='c'>到期未付:<#elseif msg=='d'>昨日到期未付:<#else>今日到期未付:</#if><span class="required"></span>
            </label>
        </div>
        <div class="form-input col-md-5">
            <input type="text" id="dayOverdue" name="dayOverdue" data-type="number"  class="parsley-validated" value="${dayOverdue}">
        </div>
        <div class="col-md-2">元</div>
    </div>
    <div class="form-row">
        <div class="form-label col-md-5">
            <label for="">
                <#if msg=='a'>7日支付失败:<#elseif msg=='b'>30日支付失败:<#elseif msg=='c'>支付失败:<#elseif msg=='d'>昨日支付失败:<#else>今日支付失败:</#if><span class="required"></span>
            </label>
        </div>
        <div class="form-input col-md-5">
            <input type="text" id="dayFailed" name="dayFailed" data-type="number"  class="parsley-validated" value="${dayFailed}">
        </div>
        <div class="col-md-2">元</div>
    </div>
    <div class="form-row">
        <div class="form-label col-md-5">
            <label for="">
                <#if msg=='a'>7日超额支付:<#elseif msg=='b'>30日超额支付:<#elseif msg=='c'>超额支付:<#elseif msg=='d'>昨日超额支付:<#else>今日超额支付:</#if><span class="required"></span>
            </label>
        </div>
        <div class="form-input col-md-5">
            <input type="text" id="dayExcess" name="dayExcess" data-type="number"  class="parsley-validated" value="${dayExcess}">
        </div>
        <div class="col-md-2">元</div>
    </div>
</div>
<div class="col-md-7" id="chart-area1" style="margin-top:50px" ></div>
</div>

<div class="pad10A">
<div class="col-md-5">
	<h3 class="content-box-header bg-gray">
		<span>人数</span>
    </h3>
    <div class="form-row">
        <div class="form-label col-md-5">
            <label for="">
                <#if msg=='a'>7日总购买人数:<#elseif msg=='b'>30日总购买人数:<#elseif msg=='c'>总购买人数:<#elseif msg=='d'>昨日购买人数:<#else>今日总购买人数:</#if><span class="required"></span>
            </label>
        </div>
        <div class="form-input col-md-5">
            <input type="text" id="numberOfBuyer" name="numberOfBuyer" data-type="number"  class="parsley-validated" value="${numberOfBuyer}" > 
        </div>
    </div>
    <div class="form-row">
        <div class="form-label col-md-5">
            <label for="">
                <#if msg=='a'>7日待付款人数:<#elseif msg=='b'>30日待付款人数:<#elseif msg=='c'>待付款人数:<#elseif msg=='d'>昨日待付款人数:<#else>今日待付款人数:</#if><span class="required"></span>
            </label>
        </div>
        <div class="form-input col-md-5">
            <input type="text" id="dayUnpayBuyer" name="dayUnpayBuyer" data-type="number"  class="parsley-validated" value="${dayUnpayBuyer}" > 
        </div>
    </div>
    <div class="form-row">
        <div class="form-label col-md-5">
            <label for="">
                <#if msg=='a'>7日已付款人数:<#elseif msg=='b'>30日已付款人数:<#elseif msg=='c'>已付款人数:<#elseif msg=='d'>昨日已付款人数:<#else>今日已付款人数:</#if><span class="required"></span>
            </label>
        </div>
        <div class="form-input col-md-5">
            <input type="text" id="dayPaidBuyer" name="dayPaidBuyer" data-type="number"  class="parsley-validated" value="${dayPaidBuyer}" > 
        </div>
    </div>
    <div class="form-row">
        <div class="form-label col-md-5">
            <label for="">
                <#if msg=='a'>7日到期未付款人数:<#elseif msg=='b'>30日到期未付款人数:<#elseif msg=='c'>到期未付款人数:<#elseif msg=='d'>昨日到期未付款人数:<#else>今日到期未付款人数:</#if><span class="required"></span>
            </label>
        </div>
        <div class="form-input col-md-5">
            <input type="text" id="dayOverdueBuyer" name="dayOverdueBuyer" data-type="number"  class="parsley-validated" value="${dayOverdueBuyer}" > 
        </div>
    </div>
    <div class="form-row">
        <div class="form-label col-md-5">
            <label for="">
                <#if msg=='a'>7日支付失败人数:<#elseif msg=='b'>30日支付失败人数:<#elseif msg=='c'>支付失败人数:<#elseif msg=='d'>昨日支付失败人数:<#else>今日支付失败人数:</#if><span class="required"></span>
            </label>
        </div>
        <div class="form-input col-md-5">
            <input type="text" id="dayFailedBuyer" name="dayFailedBuyer" data-type="number"  class="parsley-validated" value="${dayFailedBuyer}" > 
        </div>
    </div>
    <div class="form-row">
        <div class="form-label col-md-5">
            <label for="">
                <#if msg=='a'>7日超额支付人数:<#elseif msg=='b'>30日超额支付人数:<#elseif msg=='c'>超额支付人数:<#elseif msg=='d'>昨日超额支付人数:<#else>今日超额支付人数:</#if><span class="required"></span>
            </label>
        </div>
        <div class="form-input col-md-5">
            <input type="text" id="dayExcessBuyer" name="dayExcessBuyer" data-type="number"  class="parsley-validated" value="${dayExcessBuyer}" > 
        </div>
    </div>
</div>
<div class="col-md-7" id="chart-area2" style="margin-top:50px" ></div>
</div>

<div class="pad10A">
<div class="col-md-5">
	<h3 class="content-box-header bg-gray">
		<span>订单数</span>
	</h3>
    <div class="form-row">
        <div class="form-label col-md-5">
            <label for="">
                <#if msg=='a'>7日总订单数:<#elseif msg=='b'>30日总订单数:<#elseif msg=='c'>总订单数:<#elseif msg=='d'>昨日总订单数:<#else>今日总订单数:</#if>
                <span class="required"></span>
            </label>
        </div>
        <div class="form-input col-md-5">
            <input type="text" id="dayNumOfOrder"  name="dayNumOfOrder" data-type="number" class="parsley-validated" value="${dayNumOfOrder}">
        </div>
    </div>
    <div class="form-row">
        <div class="form-label col-md-5">
            <label for="">
                <#if msg=='a'>7日待付款订单数:<#elseif msg=='b'>30日待付款订单数:<#elseif msg=='c'>待付款订单数:<#elseif msg=='d'>昨日待付款订单数:<#else>今日待付款订单数:</#if>
                <span class="required"></span>
            </label>
        </div>
        <div class="form-input col-md-5">
            <input type="text" id="dayUnpayOrder"  name="dayUnpayOrder" data-type="number" class="parsley-validated" value="${dayUnpayOrder}">
        </div>
    </div>
    <div class="form-row">
        <div class="form-label col-md-5">
            <label for="">
                <#if msg=='a'>7日已付款订单数:<#elseif msg=='b'>30日已付款订单数:<#elseif msg=='c'>已付款订单数:<#elseif msg=='d'>昨日已付款订单数:<#else>今日已付款订单数:</#if>
                <span class="required"></span>
            </label>
        </div>
        <div class="form-input col-md-5">
            <input type="text" id="dayPaidOrder"  name="dayPaidOrder" data-type="number" class="parsley-validated" value="${dayPaidOrder}">
        </div>
    </div>
    <div class="form-row">
        <div class="form-label col-md-5">
            <label for="">
                <#if msg=='a'>7日到期未付订单数:<#elseif msg=='b'>30日到期未付订单数:<#elseif msg=='c'>到期未付订单数:<#elseif msg=='d'>昨日到期未付款订单数:<#else>今日到期未付订单数:</#if>
                <span class="required"></span>
            </label>
        </div>
        <div class="form-input col-md-5">
            <input type="text" id="dayOverdueOrder"  name="dayOverdueOrder" data-type="number" class="parsley-validated" value="${dayOverdueOrder}">
        </div>
    </div>
    <div class="form-row">
        <div class="form-label col-md-5">
            <label for="">
                <#if msg=='a'>7日支付失败订单数:<#elseif msg=='b'>30日支付失败订单数:<#elseif msg=='c'>支付失败订单数:<#elseif msg=='d'>昨日支付失败订单数:<#else>今日支付失败订单数:</#if>
                <span class="required"></span>
            </label>
        </div>
        <div class="form-input col-md-5">
            <input type="text" id="dayFailedOrder"  name="dayFailedOrder" data-type="number" class="parsley-validated" value="${dayFailedOrder}">
        </div>
    </div>
    <div class="form-row">
        <div class="form-label col-md-5">
            <label for="">
                <#if msg=='a'>7日超额支付订单数:<#elseif msg=='b'>30日超额支付订单数:<#elseif msg=='c'>超额支付订单数:<#elseif msg=='d'>昨日超额支付订单数:<#else>今日超额支付订单数:</#if>
                <span class="required"></span>
            </label>
        </div>
        <div class="form-input col-md-5">
            <input type="text" id="dayExcessOrder"  name="dayExcessOrder" data-type="number" class="parsley-validated" value="${dayExcessOrder}">
        </div>
    </div>
</div>
<div class="col-md-7" id="chart-area3" style="margin-top:50px" ></div>
</div>

</div>
</div>

<script type="text/javascript" src="/assets/js/minified/demo/exporting.js"></script>
<script type="text/javascript" src="/assets/js/minified/demo/highcharts.js"></script>
<script>

$(function () {
    $('#chart-area1').highcharts({
        chart: {
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: false
        },
        title: {
            text: '金额统计'
        },
        tooltip: {
    	    pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    color: '#000000',
                    connectorColor: '#000000',
                    format: '<b>{point.name}</b>: {point.percentage:.1f} %'
                }
            }
        },
        series: [{
            type: 'pie',
            name: '金额比例',
            data: [
                ['待付款金额',   ${dayUnpay}],
                ['已付款金额',   ${dayPaid}],
                ['到期未付金额',   ${dayOverdue}],
                ['支付失败金额',   ${dayFailed}],
                ['超额支付金额',   ${dayExcess}]
            ]
        }]
    });
    
    $('#chart-area2').highcharts({
        chart: {
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: false
        },
        title: {
            text: '人数统计'
        },
        tooltip: {
    	    pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    color: '#000000',
                    connectorColor: '#000000',
                    format: '<b>{point.name}</b>: {point.percentage:.1f} %'
                }
            }
        },
        series: [{
            type: 'pie',
            name: '人数比例',
            data: [
                ['待付款人数',   ${dayUnpayBuyer}],
                ['已付款人数',   ${dayPaidBuyer}],
                ['到期未付人数',   ${dayOverdueBuyer}],
                ['支付失败人数',   ${dayFailedBuyer}],
                ['超额支付人数',   ${dayExcessBuyer}]
            ]
        }]
    });
    
    $('#chart-area3').highcharts({
        chart: {
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: false
        },
        title: {
            text: '订单数统计'
        },
        tooltip: {
    	    pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    color: '#000000',
                    connectorColor: '#000000',
                    format: '<b>{point.name}</b>: {point.percentage:.1f} %'
                }
            }
        },
        series: [{
            type: 'pie',
            name: '订单数比例',
            data: [
                ['待付款订单数',   ${dayUnpayOrder}],
                ['已付款订单数',   ${dayPaidOrder}],
                ['到期未付订单数',   ${dayOverdueOrder}],
                ['支付失败订单数',   ${dayFailedOrder}],
                ['超额支付订单数',   ${dayExcessOrder}]
            ]
        }]
    });
});							

</script>